A virtual machine (“VM”) is a software construct or the like operating on a computing device or the like (e.g., a host) for the purpose of providing an emulated machine or system. Typically, although not necessarily, the VM is an application or the like, and may be employed on the host to instantiate a use application or the like while at the same time isolating such use application from such host device or from other applications on such host. In one typical situation, the host can accommodate a plurality of deployed VMs, each VM performing some predetermined function by way of resources available from the host.
Notably, each VM as hosted on a computing device is for all intents and purposes a computing machine, although in virtual form, and thus represents itself as such both to the use application thereof and to the outside world. As an example, the VM and/or a use application thereof can and in fact do issue hardware requests for hardware resources of the VM, even though the VM might not in reality have such hardware resources. Instead, and as may be appreciated, such hardware requests are intercepted or otherwise redirected toward the host, and such host services such hardware requests based on the hardware resources thereof, typically with the requesting VM and/or use application thereof being none the wiser.
Typically, although not necessarily, a host deploys each VM thereof in a separate partition, address space, processing area, and/or the like. Such host may include a virtualization layer with a virtual machine monitor (“VMM”) or the like that acts as an overseer application or ‘hypervisor’, where the virtualization layer oversees and/or otherwise manages supervisory aspects of each VM of the host, and acts as a possible link between each VM and the outside world. The VMM may be a separate application running in its own address space or may be integrated more closely with the host operating system, either directly or as an operating system extension of some sort, such as a device driver. Notably, the VMM of the host may intercept or otherwise redirect hardware requests that originate from each VM of the host and/or a use application thereof, and may at least assist in servicing the requests, again with the requesting VM and/or use application thereof being none the wiser.
Many computing systems comprise multiple processors. Processors in a multiprocessor virtual machine environment may operate in a guest mode or in a VMM mode. When running in a guest mode, a processor uses virtual machine definitions to manage the virtual machine's guest operating system and applications, translating arguments and managing system resources without intervention from the VMM. From time to time, the guest operating system or applications may need system resources that must be managed by the VMM. As examples, the VMM may be required for error handling, system faults, or interrupt handling. In these situations, the processor operates in a VMM mode.
Modern processing systems include support for interrupts, which allow processors to be notified of external events. For example, when a user presses a key on a keyboard or a network packet arrives over the wire, a corresponding interrupt is generated and sent to a processor. Typically, an interrupt causes a processor to stop what it's doing, record its current execution location so it can resume execution after servicing the interrupt, and then execute a specified interrupt service routine.
Computing systems may comprise one or more interrupt controllers that direct and arbitrate the flow of interrupts in the system. The interrupt controller logic may be embodied in a discrete hardware component, may be integrated into a processor, or may be virtualized. The interrupt controller is responsible for, among other things, determining the priority of interrupts and for directing interrupts to appropriate processors in a multi-processor environment. In a virtualized environment, processors and interrupt controllers may be virtualized. This is generally accomplished through a combination of software, such as a virtual machine monitor, and virtualization assists provided by hardware.
Generally, after an interrupt has been handled, the interrupt controller is notified via and end-of-interrupt (EOI) command. It tells the interrupt controller that other interrupts whose delivery may have been deferred while a previous interrupt was being handled may now be delivered. An EOI command is typically delivered to an interrupt controller though an I/O port or a memory-mapped I/O access, such as a read from or write to a register. For physical interrupt controllers, processing an EOI command may consume tens or hundreds of cycles. For virtualized interrupt controllers, processing an EOI command may consume thousands of cycles.
Some virtual machine monitors use interrupts as a basis for inter-partition messaging. If software running within one partition needs to communicate with software running within a second partition on the same physical machine, it is able to do so through the use of inter-partition messages. When a message is sent by one processor, the virtual machine monitor may send an interrupt to the processor that is the intended recipient of the message, causing the recipient processor's interrupt service routine to process the message and respond to its contents.